package test11;

import java.io.FileNotFoundException;
import java.io.*;


/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: YKH
 * Date: 2022-11-07
 * Time: 9:35
 */
public class Test02 {
    public static void main(String[] args) throws IOException {
        char[] c = new char[500];
        FileReader fr = new FileReader("myfilel.txt");
        int num = fr.read(c);
        String str = new String(c,0,num);
        System.out.println("读取的字符个数为:" + num + "其内容如下");
        System.out.println(str);
        FileWriter fw = new FileWriter("test.txt", true);
        fw.write(str);
        fr.close();
        fw.close();
        System.out.println("已写完");
    }
}
